package com.jinhua.admin.entity;

import com.jinhua.admin.vo.AdminUserVo;


import com.jinhua.mybatis.annotation.Column;
import com.jinhua.mybatis.annotation.Table;
import com.jinhua.mybatis.entity.BaseEntity;
import com.jinhua.mybatis.util.AutoGenerateCode;
import lombok.Data;

/**
 * Copyright
 *
 * @Author WuHuang
 * @Date 2022/10/28
 */
@Data
@Table(commit = "后台用户", prefix = "pc")
public class AdminUserPo extends BaseEntity<AdminUserPo> {
    private static final long serialVersionUID = -4026974080264001200L;

    @Column(commit = "昵称", length = 20)
    private String name;

    @Column(commit = "账号", length = 20, isNUll = false)
    private String userName;

    @Column(commit = "密码", length = 255, isNUll = false)
    private String password;

    @Column(commit = "是否为超管:0-超管,1-普通管理员")
    private String isAdmin;

    @Column(commit = "角色id", length = 20, isNUll = false, defaultVal = "0")
    private Long roleId;

    @Column(commit = "最后登录ip", length = 40)
    private String lastLoginIp;

    @Column(commit = "状态:0-正常,1-封禁", length = 3)
    private Integer status;

    @Column(commit = "创建人的ID", length = 20)
    private Long createId;

    public static void main(String[] args) {
        AutoGenerateCode.generate(AdminUserPo.class);
    }

    public AdminUserVo copyAdminUserVo() {
        AdminUserVo vo = new AdminUserVo();
        org.springframework.beans.BeanUtils.copyProperties(this, vo);
        return vo;
    }

}
